<?php 
	echo $this->Session->flash(); 
	echo $this->Session->flash('good');
	echo $this->Session->flash('bad');
?>
<table cellpadding="0" cellspacing="0" class="table-listing">
	<tr>
			<th class="col-no">
				<input type="checkbox" id="check-all" title="<?php echo __('Check All') ?>" class="rcheckbox" />
			</th>
			<th><?php echo $this->Paginator->sort('name'); ?></th>
			<th><?php echo $this->Paginator->sort('example'); ?></th>
			<th><?php echo $this->Paginator->sort('status'); ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
	foreach ($properties as $property): ?>
	<tr class="tr-row">
		<td class="col-no">
			<input type="checkbox" value="<?php echo h($property['Property']['id']); ?>" id="check-item-<?php echo h($property['Property']['id']); ?>" class="check-item" />
		</td>
		<td class="canclick"><?php echo h($property['Property']['name']); ?>&nbsp;</td>
		<td class="canclick"><?php echo h($property['Property']['example']); ?>&nbsp;</td>
		<td class="status-col canclick"><?php echo $this->Properties->showStatus($property['Property']['id'], $property['Property']['status']); ?></td>
		<td class="actions action-cm3">
			<?php echo $this->Html->link(__('Edit'), array('admin' => true, 'action' => 'edit', $property['Property']['id']), array('class' => 'act-lk edit-link')); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $property['Property']['id']), array('class' => 'act-lk del-link'), __('Are you sure you want to delete # %s?', $property['Property']['id'])); ?>
		</td>
	</tr>
	<?php endforeach; ?>
</table>


<p>
        <?php
    echo $this->Paginator->counter(array(
        'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
    ));
    ?>	</p>

<div class="paging">
    <?php
    echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>

<script type="text/javascript">
    jQuery(document).ready(function() {
        if (jQuery("#badMessage")) {
            jQuery("#badMessage").delay(10000).fadeOut(400);
        }

        if (jQuery("#goodMessage")) {
            jQuery("#goodMessage").delay(10000).fadeOut(400);
        }
    });
</script>
